program TangentCircles;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x,y,x1,y1,x2,y2,R1,R2,a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4: real;

begin
  write('x1=');
  readln(x1);
  write('y1=');
  readln(y1);
  write('x2=');
  readln(x2);
  write('y2=');
  readln(y2);
  write('R1=');
  readln(R1);
  write('R2=');
  readln(R2);

  x:=(x1-x2);
  y:=(y1-y2);

  R2:=R2+R1;

  a1:=(-R2*x-y*sqrt(x*x+y*y-R2*R2))/(x*x+y*y);
  a2:=(-R2*x+y*sqrt(x*x+y*y-R2*R2))/(x*x+y*y);
  b1:=(-R2*y*y+x*sqrt(x*x+y*y-R2*R2))/(x*x+y*y);
  b2:=(-R2*y*y-x*sqrt(x*x+y*y-R2*R2))/(x*x+y*y);
  c1:=-a1*x1-b1*y1;
  c2:=-a2*x1-b2*y1;

  a3:=(-R1*x-y*sqrt(x*x+y*y-R1*R1))/(x*x+y*y);
  a4:=(-R1*x+y*sqrt(x*x+y*y-R1*R1))/(x*x+y*y);
  b3:=(-R1*y*y+x*sqrt(x*x+y*y-R1*R1))/(x*x+y*y);
  b4:=(-R1*y*y-x*sqrt(x*x+y*y-R1*R1))/(x*x+y*y);
  c3:=-a1*x1-b1*y1;
  c4:=-a2*x1-b2*y1;

  write('a1=');
  writeln(a1);
  write('b1=');
  writeln(b1);
  write('c1=');
  writeln(c1);
  write('a2=');
  writeln(a2);
  write('b2=');
  writeln(b2);
  write('c2=');
  writeln(c2);
  write('a3=');
  writeln(a3);
  write('b3=');
  writeln(b3);
  write('c3=');
  writeln(c3);
  write('a4=');
  writeln(a4);
  write('b4=');
  writeln(b4);
  write('c4=');
  writeln(c4);
  readln;

end.
